<?php
	/**
	*	前端加载主程序
	*/


	define('PHPCHINA_DIR',__FILE__);

	require('./config.inc.php');
	require('./public/db.class.php');
	require('./public/cache.class.php');
	require('./public/upfile.class.php');
	require('./public/pagination.class.php');
	require('./public/global.func.php');

	//上传文件目录
	$uploadDir='./upload/';
	//缩略图存放目录
	$thumbDir='./upload/thumb/';

    //数据库操作对象
    $DB = new Dbconn($dbhost,$dbuser,$dbpw,$dbname,$dbcharset);

	//分页
	$Pagination = new Pagination();

	//缓存操作对象
	$makeCache = new makeCache();

	//生成站点信息缓存
	$makeCache->makeCacheFile('config');

	//包含缓存文件
	include $makeCache->getCacheFilePath('config');

	//当前模板目录
	$tplDir = './templates/'.$config_cache['cur_tplDir'].'/';

	//分页
	$PaginationObj = new Pagination();

	//文件上传操作对象
	$uploadFile = new UpFile($uploadDir);

    //生成缩略图
    //$uploadFile -> image2small('./upload/1.jpg','1.jpg');
    //添加水印
    //$uploadFile->makeWaterMark('./upload/1.jpg','./upload/thumb/1.jpg');

?>
